homeApp.service("schoolService",function(){
	
	// 添加父节点的类
	this.addParentClass = function($event,className){
		$event.target.parentNode.className += (" "+ className );
	}

	// 删除与父节点同级的类
	this.removeParentClass = function($event,className){
		var list = $event.target.parentNode.parentNode.children || $event.target.parentNode.parentNode.childNodes;
		var reg = eval("/"+className+"/g");
		$.each(list,function(index,value){
			if(value.nodeType == 1){
				value.className = value.className.replace(reg,"");
			}
		});
	}

	// 添加自身的类
	this.addSelfClass = function($event,className){
		$event.target.className += (" "+ className );
	}

	// 删除自身同级的兄弟节点的类
	this.removeSiblingsClass = function($event,className){
		var list = $event.target.parentNode.children || $event.target.parentNode.childNodes;
		var reg = eval("/"+className+"/g");
		$.each(list,function(index,value){
			if(value.nodeType == 1){
				value.className = value.className.replace(reg,"");
			}
		});
	}
})